package com.tao.static_;

public class StaticMethod {
    public static void main(String[] args) {
        stu jack = new stu("jack");
        jack.payFee(500);
        //stu.payFee(500);也可以

        stu mary = new stu("mary");
        mary.payFee(300);

        stu.showFee();

    }
}
class stu{
    private String name;
    private static double fee = 0;

    public stu(String name) {
        this.name = name;
    }
    public  void payFee(double fee){
        stu.fee += fee;
    }
    public static void showFee(){
        System.out.println("总学费：" + stu.fee);
    }
}
